//
//  MoveView.m
//  GIFShow
//
//  Created by lanou3g on 15/5/6.
//  Copyright (c) 2015年 CK. All rights reserved.
//

#import "MoveView.h"

@interface MoveView ()
@property (nonatomic, strong) UILabel * nameLabel;
@property (nonatomic, strong) UIImageView * myImageView;
@end
@implementation MoveView
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.myImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, frame.size.height, frame.size.height)];
        self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(frame.size.height, 0, frame.size.width - frame.size.height, frame.size.height)];
        [self addSubview:self.myImageView];
        [self addSubview:self.nameLabel];
        self.layer.borderColor = [UIColor lightGrayColor].CGColor;
        self.layer.cornerRadius = 2;
        self.layer.borderWidth = 0.5;
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}
-(void)setTitleName:(NSString *)titleName{
    if (_titleName != titleName) {
        _titleName = titleName;
        self.nameLabel.text = _titleName;
        self.nameLabel.font = [UIFont systemFontOfSize:13];
        self.myImageView.image = [UIImage imageNamed:_titleName];
        if ([_titleName isEqualToString:@"本周最热"]) {
            self.nameLabel.textColor = [UIColor redColor];
        }
    }
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
